<script>
if (window == top)top.location.href = "";
function checkform(){
	var company_name=trim($("input[name='company_name']").val());
	if(company_name==""){
		alert('Please enter your company name!');
		return false;
	}
	commonEffection.setLoading();
	$('#buyerIntroForm').submit();
}
$(document).ready(
	function(){
		$("select[name='businessid']").val('<?=$this->buyerArray[0]['businessid']?>');
		$("select[name='btypeid']").val('<?=$this->buyerArray[0]['btypeid']?>');
	}
);
</script>
<div class="new_mn">
        	<b class="spbg2 corner tl"></b>
    		<b class="spbg2 corner tr"></b>
    		<b class="spbg2 corner bl"></b>
    		<b class="spbg2 corner br"></b>
    		<div class="titlebar clearfix">My Account &gt; Profile</div>
    		<form name="buyerIntroForm" id="buyerIntroForm" action="adminb<?=CHOSING_DE?>info<?=CHOSING_DE?>dointro"  enctype="multipart/form-data" method="post">
    		<table class="formt" width="800">
    			<tr>
    				<td width="30%" align="right"><span class="formt-title">*Paypal Account:</span></td>
    				<td><input type="text" class="text" value="<?=$this->buyerArray[0]['paypal']?>" name="paypal" onblur="checkinput(this.value)"/></td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">*Industry:</span></td>
    				<td>
    					<select name="businessid" style="width:300">
							<? for($i=0;$i<count($this->businessArray);$i++):?>
							<option value="<?=$this->businessArray[$i]['businessid']?>"><?=$this->businessArray[$i]['name']?></option>
							<? endfor;?>
						</select>
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">*Company name:</span></td>
    				<td><input class="text" value="<?=$this->buyerArray[0]['company_name']?>" name="company_name" onblur="checkinput(this.value)"/></td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">*Business Type:</span></td>
    				<td>
    					<select name="btypeid" style="width:300">
							<? for($i=0;$i<count($this->btypeArray);$i++):?>
							<option value="<?=$this->btypeArray[$i]['btypeid']?>"><?=$this->btypeArray[$i]['name']?></option>
							<? endfor;?>
						</select>
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">Location:</span></td>
    				<td>
    					<div><input type="hidden" value="<?=$this->buyerArray[0]['location_id']?>" name="flid" id="flid" /></div>
						  <div>
							<?=$this->selectString?>
						  </div>
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">Address:</span></td>
    				<td>
    					<div id="addressShow">
							<?foreach($this->addressArray as $value):?>
								<div>
									 <span>NAME:<?php echo $value['name']?> LOCATION:
									 <?php foreach ($this->locationArray as $v):?>
									 	<?php if ($v['flid'] == $value['location_id']):?>
									 		<?php echo $v['en_flname'];?>
									 	<?php endif;?>
									 <?php endforeach;?>
									   ADDRESS:<?=$value['content']?></span>
									 <span>&nbsp;&nbsp;<img onclick="buyerAddress.dodel(this,'<?=$value['addressid']?>')" src="html/images/adminb/shut.gif" /></span>
								</div>
							<?endforeach;?>
						</div>
					  	<div id="addressDiv">
						</div>
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">Bank:</span></td>
    				<td>
    					<div id="bankShow">
							<?foreach($this->bankArray as $value):?>
								<div>
									 <span><?=$value['bank_name']?></span>: 
									 <span><?=$value['bank_account']?></span>
									 <span>&nbsp;&nbsp;<img onclick="memberBank.edit(this,'<?=$value['bankid']?>')" src="html/images/adminb/edit.gif" /></span>
									 <span>&nbsp;&nbsp;<img onclick="memberBank.dodel(this,'<?=$value['bankid']?>')" src="html/images/adminb/shut.gif" /></span>
								</div>
							<?endforeach;?>
						</div>
						<div><a onclick="memberBank.add()"><img src="html/images/adminb/add.gif" /> Add Bank</a></div>
					  	<div id="bankDiv">
						</div>	
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">Zip Code:</span></td>
    				<td>
    					<input type="text" name="zip" class="text" value="<?=$this->buyerArray[0]['zip']?>" onblur="checkinput(this.value)" id="zip">
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">Web Page:</span></td>
    				<td>
    					http:// <input type="text" name="webpage" class="text" onblur="checkinput(this.value)" value="<?=$this->buyerArray[0]['webpage']?>" />
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">My Club:</span></td>
    				<td>
    					<select name="clubid">
									<option value="0">Choose</option>
									<?php foreach ($this->clubList as $v):?>
										<option value="<?php echo $v['flid'];?>" <?php if ($this->team && $this->team['flid'] == $v['flid']) {echo 'selected';}?>><?php echo $v['en_flname'];?></option>
									<?php endforeach;?>
						</select>
    				</td>
    			</tr>
    			<tr>
    				<td align="right"><span class="formt-title">My Head Image:</span></td>
    				<td>
    					<span><input name="productpic" type="file" /></span> <input type="button" onclick="uploadImg(this);" value="上传" />
    				</td>
    			</tr>
    			<tr>
    				<td align="right">&nbsp;</td>
    				<td id="productImages">
    					<?php if($this->buyerArray[0]['headimg'] != ''):?>
						<div style="margin:10px"><a href="<?php echo $this->buyerArray[0]['headimg']?>" target="_blank"><img style="height:100px;width:100px;vertical-align:middle;" src="<?php echo $this->buyerArray[0]['headimg']?>" /></a><input type="hidden" id="headimg" name="headimg" value="<?php echo $this->buyerArray[0]['headimg']?>" />
						<?php endif;?>
    				</td>
    			</tr>
    			<tr>
    				<td align="center" colspan="2"><input name="act" type="hidden" value="save" /><input type="button" value="Save" name="save" onclick="checkform();" class="subtn spbg2" /></td>
    			</tr>
    		</table>
    		</form>
        </div>
<iframe id="productIframe" width="0" height="0" name="productIframe"></iframe>
<script type="text/javascript">
	upload.type='info';
	upload.formid='buyerIntroForm';
	
	function uploadImg(thisInput){
		upload.setAppend=function(imgurl){
			return '<div style="margin:10px"><a href="'+imgurl+'" target="_blank"><img style="height:100px;width:100px;vertical-align:middle;" src="'+imgurl+'" /></a><input type="hidden" id="headimg" name="headimg" value="'+imgurl+'" /></div>';
		}
	     upload.setImg=function(imgurl){
	        this.imgurl=imgurl;
			$('#productImages').html(this.setAppend(imgurl));
			parent.shutMsg();
			commonEffection.resetFrame('admins_frame',true);
		}
		upload.uploadimg(thisInput);
	}
</script>